
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'mtsys-base-form',
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array(
		'class' => 'form',
	),
)); ?>
<fieldset class="grey inline">
	<legend><?php echo Controller::getActionName($this->action->id); ?></legend>
	
	<div class="notification tip" style="display: block; "> 
    <span class="strong">Tip:</span> <?php echo $form->errorSummary($model); ?>
 <span class="close" title="Dismiss"></span>
    </div>   

	<label>所属单位 <span class="required">*</span></label>
    <?php
	$options = array();	
    /*
    if($provinces != NULL){
    	$options = CHtml::listData($provinces,'PROVINCE_ID','PROVINCE_NAME');    	
	}
	*/ 
	$options[0] = "请选择所在省";
	
	echo CHtml::activeDropDownList($model,'PROVINCE_ID', $options,array(
			'ajax' => array(
				'type'=>'POST',
				'url'=> array('getCitys'),
				'update'=>'#CITY_ID',
				'data'=>array('PROVINCE_ID'=>'js:$("#PROVINCE_ID").val()'),
			),
			'id'=>'PROVINCE_ID',
		));
	
	$c_options = array();
	/*
	if($citys != NULL){
		$c_options = CHtml::listData($citys,'CITY_ID','CITY_NAME');
	}
	*/
	$c_options[0] = "请选择所在市";
	echo CHtml::activeDropDownList($model,'CITY_ID', $c_options, array(
		'ajax' => array(
			'type'=>'POST',
			'url'=> array('getCountys'),
			'update'=>'#COUNTY_ID',
			'data'=>array('CITY_ID'=>'js:$("#CITY_ID").val()'),
		),
		'id'=>'CITY_ID',
	));
	
	$co_options = array();	
	/*
	if($countys != NULL){
		$co_options = CHtml::listData($countys,'COUNTY_ID','COUNTY_NAME');	
	}
	*/
	$co_options[0] = "请选择所在区";
	echo CHtml::activeDropDownList($model,'COUNTY_ID', $co_options, array(
		'id'=>'COUNTY_ID',
	));
    ?>
    
	<br/>
	<?php echo $form->labelEx($model,'BASE_TYPE'); ?>
    <?php 
	echo $form->dropDownList($model,'BASE_TYPE',CHtml::listData($base_types, 'RECORD_ID', 'BASE_TYPE'))."&nbsp;";
	?>
	<?php //echo $form->textField($model,'BASE_TYPE'); ?>
    <br/>
	<?php echo $form->labelEx($model,'BASE_NAME'); ?>
	<?php echo $form->textField($model,'BASE_NAME',array('size'=>50,'maxlength'=>50)); ?>
    <?php //echo $form->error($model,'BASE_NAME'); ?>
	<br/>

	<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存',array('class'=>'button blue')); ?>
</fieldset>
<?php $this->endWidget(); ?>

